/**
 * 网页WebView
 * @author Jim
 * @date 2019/12/18
 * @update 2020/01/18
 */
import React, {PureComponent} from 'react';
import {
  TextInput,
  Image,
  Dimensions,
  StyleSheet,
  Text,
  TouchableOpacity,
  View,
    Clipboard
} from 'react-native';
import Navigation from '../../utils/Navigation';
import Header from '../../components/Header';

import {getVideoUrl} from '../../utils/videoUtil'

const {width, height} = Dimensions.get('window');
//import {TipModal} from 'react-native-ms';

export default class Index extends PureComponent {
  constructor(props) {
    super(props);
    this.state = {
      keyword: '',
    };
  }

  onChangeText = (text) => {};

  render() {
    return (
      <>
        <Header title={'vip视频'} />
        <View style={styles.contain}>
            <Text>
                接入第三方解析，如有广告和app无关,请支持正版vip!
            </Text>


          <View style={styles.centreView}>
            <View style={styles.button_list}>
              <TouchableOpacity
                activeOpacity={1}
                style={styles.button_list_item}
                onPress={() => {
                  Navigation.navigate('webVideo', {
                    title: '腾讯视频',
                    uri: 'https://v.qq.com/',
                  });
                }}>
                <Image
                  style={styles.button_list_item_image}
                  source={require('../../images/video/1.png')}
                />
                <Text style={styles.button_list_item_text} numberOfLines={1}>
                  {'腾讯视频'}
                </Text>
              </TouchableOpacity>

              <TouchableOpacity
                activeOpacity={1}
                style={styles.button_list_item}
                onPress={() => {
                  Navigation.navigate('webVideo', {
                    title: '优酷视频',
                    uri: 'http://www.youku.com/',
                  });
                }}>
                <Image
                  style={styles.button_list_item_image}
                  source={require('../../images/video/2.png')}
                />
                <Text style={styles.button_list_item_text} numberOfLines={1}>
                  {'优酷视频'}
                </Text>
              </TouchableOpacity>

              <TouchableOpacity
                activeOpacity={1}
                style={styles.button_list_item}
                onPress={() => {
                  Navigation.navigate('webVideo', {
                    title: '爱奇艺视频',
                    uri: 'https://www.iqiyi.com/',
                  });
                }}>
                <Image
                  style={styles.button_list_item_image}
                  source={require('../../images/video/3.png')}
                />
                <Text style={styles.button_list_item_text} numberOfLines={1}>
                  {'爱奇艺视频'}
                </Text>
              </TouchableOpacity>

              <TouchableOpacity
                activeOpacity={1}
                style={styles.button_list_item}
                onPress={() => {
                  Navigation.navigate('webVideo', {
                    title: '芒果tv',
                    uri: 'https://www.mgtv.com/',
                  });
                }}>
                <Image
                  style={styles.button_list_item_image}
                  source={require('../../images/video/4.png')}
                />
                <Text style={styles.button_list_item_text} numberOfLines={1}>
                  {'芒果tv'}
                </Text>
              </TouchableOpacity>

              <TouchableOpacity
                activeOpacity={1}
                style={styles.button_list_item}
                onPress={() => {
                  Navigation.navigate('webVideo', {
                    title: '搜狐视频',
                    uri: 'https://tv.sohu.com/',
                  });
                }}>
                <Image
                  style={styles.button_list_item_image}
                  source={require('../../images/video/5.png')}
                />
                <Text style={styles.button_list_item_text} numberOfLines={1}>
                  {'搜狐视频'}
                </Text>
              </TouchableOpacity>
            </View>
          </View>
        </View>
      </>
    );
  }
}

const styles = StyleSheet.create({
  contain: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
  },
  centreView: {
    width: '100%',
    height: '50%',
    // backgroundColor: 'red',
  },
  button_list: {
    flexDirection: 'row',
    flexWrap: 'wrap',
    backgroundColor: '#fff',
    paddingHorizontal: 15,
  },
  button_list_item: {
    width: (width - 30) / 3,
    justifyContent: 'center',
    alignItems: 'center',
    marginTop: 10,
  },
  button_list_item_image: {
    width: (width - 30) / 5 - 30,
    height: (width - 30) / 5 - 30,
  },
  button_list_item_text: {
    fontSize: 12,
    color: '#000',
    marginVertical: 5,
  },
});
